﻿/*****************************************************************************  

 Version: 0.1
 Website: http://www.visuagile.com/
 
 Copyright (c) Yoganand R. All rights reserved.
 For continued development and updates, visit http://yogsbreath.net
 
 ******************************************************************************/

#region Imports

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

using VisualAgile.IBLL;
using VisualAgile.IDAL;
using VisualAgile.Model;

#endregion


namespace VisualAgile.BLL
{
    public class StoryManager : BaseManager<Story>, IStoryManager
    {
        #region Properties

        public IStoryDao StoryDao { get; set; }

        #endregion

        protected override IBaseDao<Story> getBaseDAO()
        {
            return StoryDao;
        }

        /// <summary>
        /// Create a user (the default value contains the return)
        /// </summary>
        /// <returns></returns>
        public Story NewStory()
        {
            var Story = new Story();

            //System configuration can be used
            Story.CreateTime = DateTime.Now;
            Story.Name = "New Story";
            Story.Size = 1.0F;
            Story.Primary = true;

            return Story;
        }

        /// <summary>
        /// Access to Stories
        /// </summary>
        /// <param name="ProjectName">project Id</param>
        /// <returns></returns>
        public IList GetByFeature(string FeatureID)
        {
            return StoryDao.FindByFeature(FeatureID);
        }

        /// <summary>
        /// Stories by project
        /// </summary>
        /// <param name="userId">Project ID</param>
        /// <returns></returns>
        public IList GetByProject(Guid projectId)
        {
            return StoryDao.FindByProject(projectId);
        }

        /// <summary>
        /// Access to Stories
        /// </summary>
        /// <param name="ProjectName">project Id</param>
        /// <returns></returns>
        public IList GetByIteration(string IterationID)
        {
            return StoryDao.FindByIteration(IterationID);
        }
    }
}
